package com.cdtu.stocksage.goods.service.impl;

import java.util.List;
import com.cdtu.stocksage.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cdtu.stocksage.goods.mapper.ErsGoodsEnterRecordMapper;
import com.cdtu.stocksage.goods.domain.ErsGoodsEnterRecord;
import com.cdtu.stocksage.goods.service.IErsGoodsEnterRecordService;

/**
 * 物资入库记录Service业务层处理
 * 
 * @author SL
 * @date 2025-03-12
 */
@Service
public class ErsGoodsEnterRecordServiceImpl implements IErsGoodsEnterRecordService 
{
    @Autowired
    private ErsGoodsEnterRecordMapper ersGoodsEnterRecordMapper;

    /**
     * 查询物资入库记录
     * 
     * @param id 物资入库记录主键
     * @return 物资入库记录
     */
    @Override
    public ErsGoodsEnterRecord selectErsGoodsEnterRecordById(String id)
    {
        return ersGoodsEnterRecordMapper.selectErsGoodsEnterRecordById(id);
    }

    /**
     * 查询物资入库记录列表
     * 
     * @param ersGoodsEnterRecord 物资入库记录
     * @return 物资入库记录
     */
    @Override
    public List<ErsGoodsEnterRecord> selectErsGoodsEnterRecordList(ErsGoodsEnterRecord ersGoodsEnterRecord)
    {
        return ersGoodsEnterRecordMapper.selectErsGoodsEnterRecordList(ersGoodsEnterRecord);
    }

    /**
     * 新增物资入库记录
     * 
     * @param ersGoodsEnterRecord 物资入库记录
     * @return 结果
     */
    @Override
    public int insertErsGoodsEnterRecord(ErsGoodsEnterRecord ersGoodsEnterRecord)
    {
        ersGoodsEnterRecord.setCreateTime(DateUtils.getNowDate());
        return ersGoodsEnterRecordMapper.insertErsGoodsEnterRecord(ersGoodsEnterRecord);
    }

    /**
     * 修改物资入库记录
     * 
     * @param ersGoodsEnterRecord 物资入库记录
     * @return 结果
     */
    @Override
    public int updateErsGoodsEnterRecord(ErsGoodsEnterRecord ersGoodsEnterRecord)
    {
        ersGoodsEnterRecord.setUpdateTime(DateUtils.getNowDate());
        return ersGoodsEnterRecordMapper.updateErsGoodsEnterRecord(ersGoodsEnterRecord);
    }

    /**
     * 批量删除物资入库记录
     * 
     * @param ids 需要删除的物资入库记录主键
     * @return 结果
     */
    @Override
    public int deleteErsGoodsEnterRecordByIds(String[] ids)
    {
        return ersGoodsEnterRecordMapper.deleteErsGoodsEnterRecordByIds(ids);
    }

    /**
     * 删除物资入库记录信息
     * 
     * @param id 物资入库记录主键
     * @return 结果
     */
    @Override
    public int deleteErsGoodsEnterRecordById(String id)
    {
        return ersGoodsEnterRecordMapper.deleteErsGoodsEnterRecordById(id);
    }
}
